package com.wooophone.test;

import java.util.List;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;

import weibo4j.Oauth;

import com.wooophone.buyi.bean.OAuth;
import com.wooophone.buyi.biz.OAuthBiz;

import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;

@ContextConfiguration(locations = { "classpath*:spring/applicationContext*.xml" })
public class BrandBizTestCase extends AbstractJUnit4SpringContextTests {

	@Autowired
	OAuthBiz oAuthBiz;

	@Autowired
	MongoOperations mongoOperations;

	@Test
	public void testGetChildren() {

//		OAuth oAuth = oAuthBiz.getBySessionId("1vl19b28k5rrol5e3hjs3z8m0");

		List<OAuth> oAuth = mongoOperations.findAll(OAuth.class);

		for (OAuth oAuth2 : oAuth) {
			System.out.println(oAuth2.getId());
			//System.out.println(oAuth2.getUser());
		}

	}

}
